package org.jason.model.article.dtos;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class ContributeDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(hidden = true)
    private Integer userId;

    @ApiModelProperty(value = "版块id")
    @Min(1)
    @Max(9)
    private Integer blockId = 1;

    @ApiModelProperty(value = "文章标题")
    @NotBlank
    private String title;

    @ApiModelProperty(value = "文章封面")
    @Pattern(regexp = "^(http|https)://.*$", message = "封面图片url格式不正确")
    private String coverUrl;

    @ApiModelProperty(value = "文章正文")
    @NotBlank
    private String content;

    @ApiModelProperty(value = "标签(标识文章话题)")
    private String tag = "";
}
